:foglights
// vehicle struct 0@
// vahicle handle 1@
// damage manager 2@
// car driver     3@
// camX           4@
// camY           5@
// camZ           6@
// nCorona        7@
// ret nCorona
// 0AB1: @foglights 8 struct 0@ handle 1@ damManager 2@ driver 3@ camXYZ 4@ 5@ 6@ nCoronaIn 7@ nCoronaOut 7@
if
   3@ > 0
then
    0A8D: 20@ 0xC81320 2 0
    if or
        20@ == 9
        20@ == 8
        20@ == 16
        20@ == 19
    then
        // get bump status
        0AA8: call_function_method _getPanelState struct 2@ num_params 1 pop 0 1 20@
        if
            20@ <> 1
        then
            0AA8: call_function_memethod _getLightState struct 2@ num_params 1 pop 0 HEADLIGHT_LEFT 21@
            0441: 8@ = car 1@ model
            if
                8A01: not model 8@ minimum_4wheels_vehicle
            then
                21@ = 0
            end
            if
                21@ <> 1
            then
                if
                    0D0D: 21@ = get_car 1@ component "foglight_l" // IF and SET
                then
                    21@ += 0x50
                    0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                    21@ -= 0x10
                    if
                        17@ > 0.0
                    then
                        0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 attach_corona_flare 0 type 1 150.0 radius 0.16 with_offsets 21@ intensity 100 blue 255 green 255 red 255 to_vehicle_struct 0@ unical_number 7@
                        7@ += 1
                    end
                    0A8E: 20@ = 0@ + LIGHT_STATES_OFFSET
                    20@ += F_L
                    0A8C: 20@ 1 1 0 // TURN ON
                    if
                        0D0D: 21@ = get_car 1@ component "foglight_l_2"
                    then
                        21@ += 0x50
                        0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                        21@ -= 0x10
                        if
                            17@ > 0.0
                        then
                            0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 attach_corona_flare 0 type 1 150.0 radius 0.16 with_offsets 21@ intensity 100 blue 255 green 255 red 255 to_vehicle_struct 0@ unical_number 7@
                            7@ += 1
                        end
                    end
                end
            end
            0AA8: call_function_memethod _getLightState struct 2@ num_params 1 pop 0 HEADLIGHT_RIGHT 21@
            0441: 8@ = car 1@ model
            if
                8A01: not model 8@ minimum_4wheels_vehicle
            then
                21@ = 0
            end
            if
                21@ <> 1
            then
                if
                    0D0D: 21@ = get_car 1@ component "foglight_r" // IF and SET
                then
                   21@ += 0x50
                   0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                   21@ -= 0x10
                   if
                       17@ > 0.0
                   then
                       0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 attach_corona_flare 0 type 1 150.0 radius 0.16 with_offsets 21@ intensity 100 blue 255 green 255 red 255 to_vehicle_struct 0@ unical_number 7@
                       7@ += 1
                   end
                   0A8E: 20@ = 0@ + LIGHT_STATES_OFFSET
                   20@ += F_R
                   0A8C: 20@ 1 1 0 // TURN ON
                   if
                       0D0D: 21@ = get_car 1@ component "foglight_r_2"
                   then
                       21@ += 0x50
                       0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                       21@ -= 0x10
                       if
                           17@ > 0.0
                       then
                           0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 attach_corona_flare 0 type 1 150.0 radius 0.16 with_offsets 21@ intensity 100 blue 255 green 255 red 255 to_vehicle_struct 0@ unical_number 7@
                           7@ += 1
                       end
                   end
                end
            end
        end
    end
end
0AB2: ret 1 7@